package com.code.cheney.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.hibernate.Session;
import org.springframework.beans.factory.annotation.Autowired;

import com.code.cheney.po.UserInfo;
import com.code.cheney.service.IUserService;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class selectAction extends ActionSupport {

	@Autowired
	private IUserService userService;

	public String select(HttpSession session) throws Exception {
		List<UserInfo> list = new ArrayList<UserInfo>();
		list = userService.query();
		System.out.println(list.get(0).getId());
		session.setAttribute("list", list);

		return "SUCCESS";

	}

}
